using System.Collections;
using System.Collections.Generic;
using UnityEditor.Timeline;
using UnityEngine;

public class gravity : MonoBehaviour
{
    public Rigidbody rb;
    
    public float sidewayspeed = 500;
    // Start is called before the first frame update
    void Start()
    {
        rb.useGravity = true;


    }
    // Update is called once per frame
    void FixedUpdate()
    {

        

        if (Input.GetKey("w")) ;
        {

            rb.AddForce(0, 0,500f*Time.deltaTime);


        }
        if (Input.GetKey("a"))
        {

            rb.AddForce(-500f*Time.deltaTime, 0, 0);



        }

        if (Input.GetKey("d"))
        {

            rb.AddForce(500f *Time.deltaTime, 0, 0);



        }
        if (Input.GetKey(" "))
        {

            rb.AddForce(0, 500f *Time.deltaTime, 0);
        }
    }
}
